$(document).ready(function(){  
    $('select').change(function(){  
        if($(this).children('option:selected').val() != ''){
            $(this).removeClass('selectcolor');
        }else{
            $(this).addClass('selectcolor');
        }  
    })  
})  

var checkParams = function(params) {
    var flag = true;
    $.each(params, function(i, o) {   
        if('' == $.trim(o)){
            var msg = '请您先完善信息';
            if($("input[name='"+i+"']").attr('placeholder')){
                msg = $("input[name='"+i+"']").attr('placeholder');
            }else if($("select[name='"+i+"']").attr('placeholder')){
                msg = $("select[name='"+i+"']").attr('placeholder');
            }
            falert(msg);
            flag = false;
            return false;
        }
    });
    return flag;
}

//获取html
var getTplHtml = function(flag,obj) {
    $.get('/tpl/html').success(function(content){
        var re = new RegExp("@start"+flag+"@([\\s\\S]*)@end"+flag+"@","i");
        var str = content.match(re)[1];
        obj.html(str);
    }); 
}

 //查看合同
 function viewAgreement()
 {    $(".shadow-div").css("display","block");
      $(".shadow-content").css("display","block"); 
      $.get("/agreement/register1",function(d){
                 $(".contract-info").html(d);
            });   
 } 
  //关闭合同
  function closeAgreement()
  {
      $(".shadow-div").css("display","none");
      $(".shadow-content").css("display","none");   
  }

